diff --git a/SPProxy/src/main/java/eu/stork/sp/IndexAction.java b/SPProxy/src/main/java/eu/stork/sp/IndexAction.java
index 2bde334..d657d17 100644
--- a/SPProxy/src/main/java/eu/stork/sp/IndexAction.java
+++ b/SPProxy/src/main/java/eu/stork/sp/IndexAction.java
@@ -17,10 +17,20 @@ import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionSupport;
 
 import eu.eidas.auth.commons.EidasStringUtil;
+import eu.eidas.auth.commons.attribute.AttributeDefinition;
+import eu.eidas.auth.commons.attribute.ImmutableAttributeMap;
+import eu.eidas.auth.commons.attribute.PersonType;
+import eu.eidas.auth.commons.attribute.impl.StringAttributeValueMarshaller;
+import eu.eidas.auth.commons.protocol.IRequestMessageNoMetadata;
+import eu.eidas.auth.commons.protocol.eidas.LevelOfAssurance;
+import eu.eidas.auth.commons.protocol.eidas.impl.EidasAuthenticationRequestNoMetadata;
+import eu.eidas.auth.commons.protocol.impl.EidasSamlBinding;
+import eu.eidas.auth.commons.protocol.impl.SamlNameIdFormat;
+import eu.eidas.auth.commons.protocol.eidas.LevelOfAssuranceComparison;
 import eu.eidas.auth.engine.ProtocolEngineFactoryNoMetadata;
 import eu.eidas.auth.engine.ProtocolEngineNoMetadataI;
+import eu.eidas.auth.engine.xml.opensaml.SecureRandomXmlIdGenerator;
 import eu.eidas.engine.exceptions.EIDASSAMLEngineException;
-import eu.stork.peps.auth.commons.STORKAuthnRequest;
 
 /**
  * 
@@ -37,7 +47,6 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 	static final Logger logger = LoggerFactory.getLogger(IndexAction.class
 			.getName());
 
-	private HttpServletRequest request;
 	private String SAMLRequest;
 	private String samlRequestXML;
 
@@ -45,8 +54,7 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 	
 	private List<String> proxyUrls;
 	private String selectUrl;
-	
-	private static String spId;
+
 	private static String providerName;
 	private static String spSector;
 	private static String spApplication;
@@ -54,8 +62,6 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 	/* Requested parameters */
 	private String pepsUrl;
 
-	private String qaa;
-
 	private String returnUrl;
 
 	// Checkboxes para excluir mecanismos de autenticación
@@ -91,16 +97,11 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 		}
 
 		returnUrl = configs.getProperty(Constants.SP_RETURN);
-		qaa = configs.getProperty(Constants.SP_QAALEVEL);
-		spId = configs.getProperty(Constants.PROVIDER_NAME);
 		providerName = configs.getProperty(Constants.PROVIDER_NAME);
 		spSector = configs.getProperty(Constants.SP_SECTOR);
 		spApplication = configs.getProperty(Constants.SP_APLICATION);
 		pepsUrl = selectUrl;
 
-		int nAttr = Integer.parseInt(configs
-				.getProperty(Constants.ATTRIBUTE_NUMBER));
-
 		// Rellenar la lista para forzar un IdP
 		opcionesIdP = new ArrayList<String>();
 		opcionesIdP.add("@Firma");
@@ -118,33 +119,86 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 
 		byte[] token = null;
 
-		STORKAuthnRequest authnRequest = new STORKAuthnRequest();
-
-		authnRequest.setDestination(pepsUrl);
-		authnRequest.setProviderName(providerName);
-		authnRequest.setQaa(Integer.parseInt(qaa));
-		authnRequest.setPersonalAttributeList(pAttList);
-		authnRequest.setAssertionConsumerServiceURL(returnUrl);
-
-		// new parameters
-		authnRequest.setSpSector(spSector);
-		authnRequest.setSpApplication(spApplication);
-
-		// V-IDP parameters
-		authnRequest.setSPID(spId);
-		authnRequest.setForceAuthN(isForceAuth());
-
-		try {
+		ImmutableAttributeMap.Builder reqAttrMapBuilder = new ImmutableAttributeMap.Builder();
+		if (checkAFirma) {
+			reqAttrMapBuilder.put(new AttributeDefinition.Builder<String>().nameUri("http://es.minhafp.clave/AFirmaIdP")
+					.friendlyName("AFirmaIdP")
+					.personType(PersonType.NATURAL_PERSON)
+					.required(false)
+					.uniqueIdentifier(true)
+					.xmlType("http://www.w3.org/2001/XMLSchema", "AFirmaIdPType", "cl")
+					.attributeValueMarshaller(new StringAttributeValueMarshaller())
+					.build());
+		}
+		if (checkSS) {
+			reqAttrMapBuilder.put(new AttributeDefinition.Builder<String>().nameUri("http://es.minhafp.clave/GISSIdP")
+					.friendlyName("GISSIdP")
+					.personType(PersonType.NATURAL_PERSON)
+					.required(false)
+					.uniqueIdentifier(true)
+					.xmlType("http://www.w3.org/2001/XMLSchema", "GISSIdPType", "cl")
+					.attributeValueMarshaller(new StringAttributeValueMarshaller())
+					.build());
+		}
+		if (checkAEAT) {
+			reqAttrMapBuilder.put(new AttributeDefinition.Builder<String>().nameUri("http://es.minhafp.clave/AEATIdP")
+					.friendlyName("AEATIdP")
+					.personType(PersonType.NATURAL_PERSON)
+					.required(false)
+					.uniqueIdentifier(true)
+					.xmlType("http://www.w3.org/2001/XMLSchema", "AEATIdPType", "cl")
+					.attributeValueMarshaller(new StringAttributeValueMarshaller())
+					.build());
+		}
+		if (checkStork) {
+			reqAttrMapBuilder.put(new AttributeDefinition.Builder<String>().nameUri("http://es.minhafp.clave/EIDASIdP")
+					.friendlyName("EIDASIdP")
+					.personType(PersonType.NATURAL_PERSON)
+					.required(false)
+					.uniqueIdentifier(true)
+					.xmlType("http://www.w3.org/2001/XMLSchema", "EIDASIdP", "cl")
+					.attributeValueMarshaller(new StringAttributeValueMarshaller())
+					.build());
+		}
+		
+		reqAttrMapBuilder.putPrimaryValues(new AttributeDefinition.Builder<String>().nameUri("http://es.minhafp.clave/RelayState")
+    			.friendlyName("RelayState")
+    			.personType(PersonType.NATURAL_PERSON)
+    			.required(false)
+    			.uniqueIdentifier(true)
+    			.xmlType("http://eidas.europa.eu/attributes/naturalperson", "PersonIdentifierType", "eidas-natural")
+    			.attributeValueMarshaller(new StringAttributeValueMarshaller())
+    			.build(), SecureRandomXmlIdGenerator.INSTANCE.generateIdentifier(8));
+
+		EidasAuthenticationRequestNoMetadata.Builder reqBuilder = new EidasAuthenticationRequestNoMetadata.Builder();
+        
+        reqBuilder.destination(pepsUrl);
+        reqBuilder.providerName(providerName);
+        reqBuilder.requestedAttributes(reqAttrMapBuilder.build());
+        reqBuilder.levelOfAssurance(LevelOfAssurance.LOW.stringValue());
+        reqBuilder.levelOfAssuranceComparison(LevelOfAssuranceComparison.fromString("minimum").stringValue());
+        reqBuilder.nameIdFormat(SamlNameIdFormat.UNSPECIFIED.getNameIdFormat());
+        reqBuilder.binding(EidasSamlBinding.POST.getName());
+        reqBuilder.assertionConsumerServiceURL(returnUrl);
+        reqBuilder.forceAuth(isForceAuth());
+        
+        reqBuilder.spType(spSector);
+        reqBuilder.spApplication(spApplication);
+        
+        IRequestMessageNoMetadata binaryRequestMessage = null;
+        EidasAuthenticationRequestNoMetadata authRequest = null;
+        try {
+            authRequest = reqBuilder.build();
 			ProtocolEngineNoMetadataI engine = ProtocolEngineFactoryNoMetadata.getDefaultProtocolEngine(Constants.SP_CONF);
-			authnRequest = engine.generateSTORKAuthnRequest(authnRequest);
+			binaryRequestMessage = engine.generateRequestMessage(authRequest);
 		} catch (EIDASSAMLEngineException e) {
 			logger.error(e.getMessage());
 			throw new ApplicationSpecificServiceException(
 					"Could not generate token for Saml Request",
 					e.getErrorMessage());
 		}
-
-		token = authnRequest.getTokenSaml();
+        
+        token = binaryRequestMessage.getMessageBytes();
 
 		SAMLRequest = EidasStringUtil.encodeToBase64(token);
 		samlRequestXML = new String(token);
@@ -171,33 +225,43 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 		}
 
 		returnUrl = configs.getProperty(Constants.SP_RETURN);
-		qaa = configs.getProperty(Constants.SP_QAALEVEL);
-		spId = configs.getProperty(Constants.PROVIDER_NAME);
 		providerName = configs.getProperty(Constants.PROVIDER_NAME);
-		spSector = configs.getProperty(Constants.SP_SECTOR);
 		spApplication = configs.getProperty(Constants.SP_APLICATION);
 		pepsUrl = selectUrl;
 
 		byte[] token = null;
-
-		STORKAuthnRequest authnRequest = new STORKAuthnRequest();
-
-		authnRequest.setDestination(pepsUrl);
-		authnRequest.setProviderName(providerName);
-		authnRequest.setQaa(Integer.parseInt(qaa));
-		authnRequest.setPersonalAttributeList(pAttList);
-		authnRequest.setAssertionConsumerServiceURL(returnUrl);
-
-		// new parameters
-		authnRequest.setSpSector(spSector);
-		authnRequest.setSpApplication(spApplication);
-
-		// V-IDP parameters
-		authnRequest.setSPID(spId);
-
-		try {
+		
+		ImmutableAttributeMap.Builder reqAttrMapBuilder = new ImmutableAttributeMap.Builder();
+        
+        reqAttrMapBuilder.putPrimaryValues(new AttributeDefinition.Builder<String>().nameUri("http://es.minhafp.clave/RelayState")
+    			.friendlyName("RelayState")
+    			.personType(PersonType.NATURAL_PERSON)
+    			.required(false)
+    			.uniqueIdentifier(true)
+    			.xmlType("http://eidas.europa.eu/attributes/naturalperson", "PersonIdentifierType", "eidas-natural")
+    			.attributeValueMarshaller(new StringAttributeValueMarshaller())
+    			.build(), SecureRandomXmlIdGenerator.INSTANCE.generateIdentifier(8));
+        
+        EidasAuthenticationRequestNoMetadata.Builder reqBuilder = new EidasAuthenticationRequestNoMetadata.Builder();
+        
+        reqBuilder.destination(pepsUrl);
+        reqBuilder.providerName(providerName);
+        reqBuilder.requestedAttributes(reqAttrMapBuilder.build());
+        reqBuilder.levelOfAssurance(LevelOfAssurance.LOW.stringValue());
+        reqBuilder.levelOfAssuranceComparison(LevelOfAssuranceComparison.fromString("minimum").stringValue());
+        reqBuilder.nameIdFormat(SamlNameIdFormat.UNSPECIFIED.getNameIdFormat());
+        reqBuilder.binding(EidasSamlBinding.POST.getName());
+        reqBuilder.assertionConsumerServiceURL(returnUrl);
+        reqBuilder.forceAuth(forceAuth);
+        
+        reqBuilder.spApplication(spApplication);
+        
+        IRequestMessageNoMetadata binaryRequestMessage = null;
+        EidasAuthenticationRequestNoMetadata authRequest = null;
+        try {
+            authRequest = reqBuilder.build();
 			ProtocolEngineNoMetadataI engine = ProtocolEngineFactoryNoMetadata.getDefaultProtocolEngine(Constants.SP_CONF);
-			authnRequest = engine.generateSTORKAuthnRequest(authnRequest);
+			binaryRequestMessage = engine.generateRequestMessage(authRequest);
 		} catch (EIDASSAMLEngineException e) {
 			logger.error(e.getMessage());
 			throw new ApplicationSpecificServiceException(
@@ -205,7 +269,7 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 					e.getErrorMessage());
 		}
 
-		token = authnRequest.getTokenSaml();
+		token = binaryRequestMessage.getMessageBytes();
 
 		SAMLRequest = EidasStringUtil.encodeToBase64(token);
 		samlRequestXML = new String(token);
@@ -269,28 +333,12 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 		return SAMLRequest;
 	}
 
-	public String getQaa() {
-		return qaa;
-	}
-
-	public void setQaa(String qaa) {
-		this.qaa = qaa;
-	}
-
-	public String getSpId() {
-		return spId;
-	}
-
-	public void setSpId(String spId) {
-		this.spId = spId;
-	}
-
 	public String getProviderName() {
 		return providerName;
 	}
 
-	public void setProviderName(String providerName) {
-		this.providerName = providerName;
+	public void setProviderName(String provName) {
+		providerName = provName;
 	}
 
 	public String getSelectUrl() {
@@ -334,7 +382,6 @@ public class IndexAction extends ActionSupport implements ServletRequestAware,
 	}
 
 	public void setServletRequest(HttpServletRequest request) {
-		this.request = request;
 	}
 
 	public void setServletResponse(HttpServletResponse response) {